export pretty-arch-id: (sem_id) -> rope
export pretty-arch-exception: (sem_exception) -> rope

val arch-show-id r =
  case r of
	   Sem_PC: "PC"
	 | Sem_ZERO: "zero"
	 | Sem_AT: "at"
	 | Sem_V0: "v0"
	 | Sem_V1: "v1"
	 | Sem_A0: "a0"
	 | Sem_A1: "a1"
	 | Sem_A2: "a2"
	 | Sem_A3: "a3"
	 | Sem_T0: "t0"
	 | Sem_T1: "t1"
	 | Sem_T2: "t2"
	 | Sem_T3: "t3"
	 | Sem_T4: "t4"
	 | Sem_T5: "t5"
	 | Sem_T6: "t6"
	 | Sem_T7: "t7"
	 | Sem_S0: "s0"
	 | Sem_S1: "s1"
	 | Sem_S2: "s2"
	 | Sem_S3: "s3"
	 | Sem_S4: "s4"
	 | Sem_S5: "s5"
	 | Sem_S6: "s6"
	 | Sem_S7: "s7"
	 | Sem_T8: "t8"
	 | Sem_T9: "t9"
	 | Sem_K0: "k0"
	 | Sem_K1: "k1"
	 | Sem_GP: "gp"
	 | Sem_SP: "sp"
	 | Sem_S8: "s8"
	 | Sem_RA: "ra"
	 | Sem_HI: "HI"
	 | Sem_LO: "LO"
	 | Sem_F0: "f0"
	 | Sem_F1: "f1"
	 | Sem_F2: "f2"
	 | Sem_F3: "f3"
	 | Sem_F4: "f4"
	 | Sem_F5: "f5"
	 | Sem_F6: "f6"
	 | Sem_F7: "f7"
	 | Sem_F8: "f8"
	 | Sem_F9: "f9"
	 | Sem_F10: "f10"
	 | Sem_F11: "f11"
	 | Sem_F12: "f12"
	 | Sem_F13: "f13"
	 | Sem_F14: "f14"
	 | Sem_F15: "f15"
	 | Sem_F16: "f16"
	 | Sem_F17: "f17"
	 | Sem_F18: "f18"
	 | Sem_F19: "f19"
	 | Sem_F20: "f20"
	 | Sem_F21: "f21"
	 | Sem_F22: "f22"
	 | Sem_F23: "f23"
	 | Sem_F24: "f24"
	 | Sem_F25: "f25"
	 | Sem_F26: "f26"
	 | Sem_F27: "f27"
	 | Sem_F28: "f28"
	 | Sem_F29: "f29"
	 | Sem_F30: "f30"
	 | Sem_F31: "f31"
	 | Sem_FIR: "FIR"
	 | Sem_FCCR: "FCCR"
	 | Sem_FEXR: "FEXR"
	 | Sem_FENR: "FENR"
	 | Sem_FCSR: "FCSR"
	 | Sem_SREG: "SREG"
	 | Sem_LLBIT: "LLBit"
	 | Sem_DEBUG: "Debug"
	 | Sem_CONFIG1: "Config1"
	 | Sem_ISA_MODE: "ISA Mode"
	 | Sem_SRSCTL: "SRSCtl"
	 | Sem_CONFIG3: "Config3"
	 | Sem_EPC: "EPC"
	 | Sem_ERROR_EPC: "ErrorEPC"
	 | Sem_DEPC: "DEPC"
	 | Sem_CPUNUM: "CPUNum"
	 | Sem_SYNCI_STEP: "SYNCI Step Size"
	 | Sem_CC: "CC"
	 | Sem_CCRES: "CCRes"
	 | Sem_ULR: "ULR"
	 | Sem_C2CCREG: "Cop2CC"
   end

val pretty-arch-id r = arch-show-id r

val pretty-arch-exception exception =
   case exception of
      SEM_EXC_OVERFLOW : "{Exception: Overflow}"
    | SEM_EXC_VADDR_ERROR : "{Exception: Virtual Address Error}"
    | SEM_EXC_TRAP : "{Exception: Trap}"
    | SEM_EXC_SYSTEM_CALL : "{Exception: System Call}"
    | SEM_EXC_BREAKPOINT : "{Exception: Breakpoint}"
    | SEM_EXC_DEBUG_BREAKPOINT : "{Exception: Debug Breakpoint}"
    | SEM_EXC_DEBUG_MODE_BREAKPOINT : "{Exception: Debug Mode Breakpoint}"
    | SEM_EXC_RESERVED_INSTRUCTION : "{Exception: Reserved Instruction}"
   end
